package com.szgz.platform.enums;

import com.szgz.platform.exception.BusinessException;

public enum EnvTypeEnum {
    IDE("IDE", "集成开发环境"),
    JUPYTER("JUPYTER", "Jupyter Notebook"),
    JUPYTER_LIGHT("JUPYTER_LIGHT", "轻量级Jupyter Lab"),
    JUPYTER_HUB("JUPYTER_HUB", "多租户版JUPYTER_HUB"),
    REDIS("REDIS", "Redis缓存"),
    MYSQL("MYSQL", "MySQL数据库"),
    RABBITMQ("RABBITMQ", "RabbitMQ消息队列"),
    ELASTICSEARCH("ELASTICSEARCH", "Elasticsearch搜索引擎"),
    VIRTUAL_DESKTOP("VIRTUAL_DESKTOP", "虚拟桌面");

    private final String type;
    private final String description;

    EnvTypeEnum(String type, String description) {
        this.type = type;
        this.description = description;
    }

    public String getType() {
        return type;
    }

    public String getDescription() {
        return description;
    }

    public static EnvTypeEnum getByType(String type) {
        for (EnvTypeEnum envTypeEnum : values()) {
            if (envTypeEnum.type.equals(type)) {
                return envTypeEnum;
            }
        }
        throw new BusinessException("暂不支持" + type + "环境类型");
    }

    @Override
    public String toString() {
        return this.type;
    }


}
